-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KP] Expose new es client #73651
[KP] Expose new es client #73651
Conversation
338954a
to
e4bbdf5
Compare
Pinging @elastic/kibana-platform (Team:Platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pretty simple expose change. Had one question about test coverage w/ security enabled, but it's possible we have similar coverage somewhere else that I am not aware of.
test/plugin_functional/plugins/elasticsearch_client_plugin/server/plugin.ts
Show resolved
Hide resolved
@@ -22,6 +22,7 @@ import { CatTasksParams } from 'elasticsearch'; | |||
import { CatThreadPoolParams } from 'elasticsearch'; | |||
import { ClearScrollParams } from 'elasticsearch'; | |||
import { Client } from 'elasticsearch'; | |||
import { ClientOptions } from '@elastic/elasticsearch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea why it's here. it's not used in the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷♂️
@@ -22,6 +22,7 @@ import { CatTasksParams } from 'elasticsearch'; | |||
import { CatThreadPoolParams } from 'elasticsearch'; | |||
import { ClearScrollParams } from 'elasticsearch'; | |||
import { Client } from 'elasticsearch'; | |||
import { ClientOptions } from '@elastic/elasticsearch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷♂️
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
* mark legacy ES client types as deprecated * expose es client to plugins and update mocks * ElasticSearchClientMock --> ElasticsearchClientMock * expose es client mocks * expose es client via RequestHandlerContext * convert test/plugin_functional/config into ts * convert top_nav test into ts * add an integration test for the es client * update comments to refer to the new es client * fix import paths. do not use extensions temp * update docs * fix other refs * add test for a custom client * fix context * add test for scoped client * update docs # Conflicts: # scripts/functional_tests.js
* mark legacy ES client types as deprecated * expose es client to plugins and update mocks * ElasticSearchClientMock --> ElasticsearchClientMock * expose es client mocks * expose es client via RequestHandlerContext * convert test/plugin_functional/config into ts * convert top_nav test into ts * add an integration test for the es client * update comments to refer to the new es client * fix import paths. do not use extensions temp * update docs * fix other refs * add test for a custom client * fix context * add test for scoped client * update docs # Conflicts: # scripts/functional_tests.js
Summary
This PR exposes new elasticsearch client to the plugins on the server-side. The new client is available via:
requestHandlerContext
coreStart
contract of the elasticsearch service:Migration guide for the new elasticsearch client available in https://github.com/elastic/kibana/blob/master/src/core/MIGRATION_EXAMPLES.md#elasticsearch-client
The legacy client is going to be deprecated and removed in
7.x
.Checklist
Delete any items that are not applicable to this PR.
For maintainers
Dev Docs
Kibana provides the new elasticsearch client as a part of the elasticsearch service on the server-side. The legacy client is deprecated on and subject for removal in
7.x
. Reference the provided migration guide to refactor your code https://github.com/elastic/kibana/blob/master/src/core/MIGRATION_EXAMPLES.md#elasticsearch-client